feat(create-vite): stricter TS configs in templates#12604
Conversation
|
|
19d6ec7 to
d2e3856
Compare
bluwy
left a comment
There was a problem hiding this comment.
I like the options separation 👍
|
Why were explicit extensions added? I think users generally expect bundlers to be able to resolve basic extensions. As for TS files, TS does support importing |
|
The TS doesn't allow This is now over with TS 5, and I really want all this resolution problems to go away so that's why I defaulted the config to use explicit extensions. This avoids a lot of syscall. Can't believe this video is 5 years old: https://www.youtube.com/watch?v=M3BM9TB-8yA |
I started with
allowImportingTsExtensionsand then realised some where not enough strict and not homogenous at all.Changes:
ES2021.stringto the listallowSyntheticDefaultImportsandallowSyntheticDefaultImports: Personally I don't like using a default export when the lib doesn't explicitly set one and expecting it to work because bundler are doing crazy amount of interop.noPropertyAccessFromIndexSignature: I started using it recently and I quite like it. I'm hesitant to add ituseUnknownInCatchVariables: could be added but it's really annoying to not be able to set the error type toAxiosErrorfor ex.Note: I did not touch the svelte config because it already extend the one from the svelte team (and I know they don't use TS the same way as I do at all)